[XPU] keep generator state of sycl kernel align with pytorch#41771
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the forward_xpu method in vllm/v1/sample/ops/topk_topp_sampler.py to correctly advance the random number generator state after a sampling operation. It increments the offset by the number of logit elements and updates the generator state accordingly. I have no feedback to provide as there were no review comments.
Contributor
|
Hi @yma11, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
Contributor
Author
|
@jikunshang can you help take a look at this change? |
jikunshang
approved these changes
May 8, 2026
| torch.ops.vllm.xpu_topk_topp_sampler( | ||
| random_sampled, logits_to_return, logits, k, p, self.logprobs_mode, seeds | ||
| ) | ||
| offset += logits.numel() |
Member
There was a problem hiding this comment.
better add some comments to illustrate reason..
Signed-off-by: Yan Ma <yan.ma@intel.com>
weifang231
pushed a commit
to weifang231/eb-vllm
that referenced
this pull request
May 13, 2026
…oject#41771) Signed-off-by: Yan Ma <yan.ma@intel.com> Co-authored-by: Qiming Zhang <qiming1.zhang@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
5 tasks
mfylcek
pushed a commit
to mfylcek/vllm
that referenced
this pull request
May 19, 2026
…oject#41771) Signed-off-by: Yan Ma <yan.ma@intel.com> Co-authored-by: Qiming Zhang <qiming1.zhang@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
jhu960213
pushed a commit
to jhu960213/vllm
that referenced
this pull request
May 20, 2026
…oject#41771) Signed-off-by: Yan Ma <yan.ma@intel.com> Co-authored-by: Qiming Zhang <qiming1.zhang@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
h1t35h
pushed a commit
to h1t35h/vllm
that referenced
this pull request
May 21, 2026
…oject#41771) Signed-off-by: Yan Ma <yan.ma@intel.com> Co-authored-by: Qiming Zhang <qiming1.zhang@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This change fixes repeated output detected by image/video input for models like
deepseek-ocr,minicpm-v-4, etc.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.